<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改人员请假')" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ask-edit" th:object="${zhmkAsk}">
            <input name="askId" th:field="*{askId}" type="hidden">
            <input name="userId" th:field="*{userId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">人员ID：</label>
                <div class="col-sm-8">
                    <!--<input name="userId" th:field="*{userId}" class="form-control" type="text">-->
                    <input th:value="${user.userName}" class="form-control" type="text" readonly="true">
                    <!--<select id="user" name="userId" class="form-control">
                        <option value="">所有</option>
                        <option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}" th:selected="(${user.userId} ==*{userId})"></option>
                    </select>-->
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">人员状态：</label>
                <div class="col-sm-8">
                    <select name="userType" class="form-control m-b" th:with="type=${@dict.getType('zhmk_user_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">请假状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('zhmk_ask_status')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="askStartDate" th:value="${#dates.format(zhmkAsk.askStartDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="askEndDate" th:value="${#dates.format(zhmkAsk.askEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">请假时间：</label>
                <div class="col-sm-8">
                    <div class="input-group input-daterange select-time">
                        <input type="text" class="time-input form-control" id="startTime" placeholder="开始时间" name="askStartDate" th:value="${#dates.format(zhmkAsk.askStartDate, 'yyyy-MM-dd')}"/>
                        <span class="input-group-addon">到</span>
                        <input type="text" class="time-input form-control" id="endTime" placeholder="结束时间" name="askEndDate" th:value="${#dates.format(zhmkAsk.askEndDate, 'yyyy-MM-dd')}"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "zhmk/ask";
        $("#form-ask-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-ask-edit').serialize());
            }
        }

        /*$("input[name='askStartDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='askEndDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });*/

    </script>
</body>
</html>